<div class="da-list-wrap">
  <div class="da-content-banner">
    <d-breadcrumb>
      <d-breadcrumb-item><a routerLink="/">{{ 'product.breadcrumb.home' | translate }}</a></d-breadcrumb-item>
      <d-breadcrumb-item><a routerLink="/pages/product/productJob">{{ 'product.breadcrumb.productJob' | translate }}</a></d-breadcrumb-item>
      <d-breadcrumb-item>{{ 'product.breadcrumb.addProductJob' | translate }}</d-breadcrumb-item>
    </d-breadcrumb>
  </div>
  <div class="da-content-wrapper">
        <div class="da-form-container ">
          <div class="card">
            <div class="card-title">
                <p class="form-title">生产工单—制单</p>
            </div>
            <form dForm ngForm [layout]="layoutDirection" [labelSize]="'sm'"[labelAlign]="'end'" class="mt-5" (dSubmit)="submit($event)" >
                <div class="form-body">
                  <d-panel #basic [isCollapsed]="isCollapsed.basic" [showAnimation]="true" [hasLeftPadding]="false">
                    <d-panel-header>
                      <div>
                        <h4>工单录入<em class="icon icon-select-arrow" [ngClass]="{ open: basic.isCollapsed }"></em></h4>
                      </div>
                    </d-panel-header>
                    <d-panel-body>
                      <div class="mt-3">
                        <d-button (btnClick)="selectMom()">提取MOM明细</d-button>
                      </div>
                      <div class="grid mt-3">
                        <div class="u-1-2 ">
                          <d-form-item>
                            <d-form-label>
                              <span class="label"><span class="Required">*</span>工单号</span>
                            </d-form-label>
                            <d-form-control>
                              <input dTextInput class="form-input-box" name="工单编码"  [(ngModel)]="Ticket.jobNum" [dValidateRules]="FormRules.jobNum" >
                            </d-form-control>
                          </d-form-item>
                        </div>
                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label">销售订单号</span>
                            </d-form-label>
                            <d-form-control>
                              <input dTextInput class="form-input-box" name="销售订单号" [(ngModel)]="Ticket.saleOrderNum" [dValidateRules]="FormRules.saleOrderNum" readonly (click)="selectOrder()">
                            </d-form-control>
                          </d-form-item>
                        </div>
                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label"><span class="Required">*</span>产品编码</span>
                            </d-form-label>
                            <d-form-control>
                              <input dTextInput class="form-input-box" name="产品编码" [(ngModel)]="Ticket.productNum" (click)="SelectMaterial()" placeholder="点击选择物料" [dValidateRules]="FormRules.productNum">
                            </d-form-control>
                          </d-form-item>
                        </div>
                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label"><span class="Required">*</span>产品名称</span>
                            </d-form-label>
                            <d-form-control>
                              <input dTextInput class="form-input-box" name="产品名称" (click)="SelectMaterial()" placeholder="点击选择物料" [(ngModel)]="Ticket.productName" [dValidateRules]="FormRules.productName">
                            </d-form-control>
                          </d-form-item>
                        </div>
                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label">规格</span>
                            </d-form-label>
                            <d-form-control>
                              <input dTextInput class="form-input-box" name="规格" disabled [(ngModel)]="Ticket.partType">
                            </d-form-control>
                          </d-form-item>
                        </div>
                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label">单位</span>
                            </d-form-label>
                            <d-form-control>
                              <input dTextInput class="form-input-box" name="单位" disabled [(ngModel)]="Ticket.uom">
                            </d-form-control>
                          </d-form-item>
                        </div>
                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label"><span class="Required">*</span>生产数量</span>
                            </d-form-label>
                            <d-form-control>
                              <d-input-number class="input-number" name="生产数量" [allowEmpty]="true" [(ngModel)]="Ticket.productionQuantity" (ngModelChange)="productionQuantityChange()" [dValidateRules]="FormRules.productionQuantity"  [min]="0" [max]="productionQuantityMax">
                              </d-input-number>
                            </d-form-control>
                          </d-form-item>
                        </div>
                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label"><span class="Required">*</span>工单优先级</span>
                            </d-form-label>
                            <d-form-control>
                              <d-select  [options]="Priority" name="工单优先级" [direction]="'up'" [(ngModel)]="Ticket.orderPriority"></d-select>
                            </d-form-control>
                          </d-form-item>
                        </div>
                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label"><span class="Required">*</span>计划开始时间</span>
                            </d-form-label>
                            <d-form-control>
                              <d-datepicker-pro name="计划开始时间" [(ngModel)]="Ticket.jobOrderPlanStartDate" [dValidateRules]="FormRules.jobOrderPlanStartDate" [maxDate]="Ticket.jobOrderPlanEndDate" (ngModelChange)="jobOrderPlanStartDateChange($event)" [showTime]="true"></d-datepicker-pro>
                            </d-form-control >
                          </d-form-item>
                        </div>
                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label"><span class="Required">*</span>计划结束时间</span>
                            </d-form-label>
                            <d-form-control>
                              <d-datepicker-pro name="计划结束时间" [(ngModel)]="Ticket.jobOrderPlanEndDate" [dValidateRules]="FormRules.jobOrderPlanEndDate" [minDate]="Ticket.jobOrderPlanStartDate" (ngModelChange)="jobOrderPlanEndDateChange($event)" [showTime]="true"></d-datepicker-pro>
                            </d-form-control>
                          </d-form-item>
                        </div>

                        <div class="u-1-2">
                          <d-form-item>
                            <d-form-label>
                              <span class="label">工单附件</span>
                            </d-form-label>
                            <d-form-control>
                              <d-button bsStyle="common"  (btnClick)="onButtonClick()">
                                <span class="icon icon-upload"></span>
                                上传附件
                              </d-button>
                            </d-form-control>
                          </d-form-item>
                        </div>
                        <div class="u-1-2"></div>
                        <div class="u-1-1">
                          <d-form-item>
                            <d-form-label>
                              <span class="label">备注</span>
                            </d-form-label>
                            <d-form-control>
                              <textarea dTextarea class="form-textarea" name="备注" [(ngModel)]="Ticket.note"></textarea>
                            </d-form-control>
                          </d-form-item>
                        </div>
                      </div>
                    </d-panel-body>
                  </d-panel>
                  <div #momView>
                    <d-panel #mom [isCollapsed]="isCollapsed.mom" [showAnimation]="true" [hasLeftPadding]="false" class="mt-3" (toggle)="paneltToggle()" [beforeToggle]="">
                      <d-panel-header>
                        <div>
                          <h4>MOM明细<em class="icon icon-select-arrow" [ngClass]="{ open: mom.isCollapsed }"></em></h4>
                        </div>
                      </d-panel-header>
                      <d-panel-body>
                        <div class="mom">
                          <div class="momtree">
                            <div class="card-body">
                              <d-operable-tree *ngIf="isCollapsed.mom" #operableTree1 [tree]="treeData"  [treeNodeTitleKey]="'title'" (nodeSelected)="nodeSelected($event)" [iconLeaf]="iconLeaf"
                              [dropType]="dropType"  (nodeDeleted)="onOperableNodeDeleted($event)"
                              >
                              <ng-template #iconTemplate let-node="node">
                                <span [ngClass]="{ 'my-icon ': node?.originItem.icon.icon }" class="{{  node?.originItem.icon.icon }}"><i class=""></i></span>
                              </ng-template>
                              <ng-template  #operatorTemplate let-optree let-node="node"  let-deleteNode="deleteNode">
                                <span *ngIf="!node.data.disableDelete" class="op-icons icon icon-close" (click)="deleteNode($event, node)"></span>
                              </ng-template>
                              <ng-template #nodeTemplate let-node="node" let-optree let-deleteNode="deleteNode">
                                <div (click)="nodeSelected($event, node)" [ngClass]="{'chongfu': node?.originItem?.backgroundColor}">
                                  <span>
                                    {{node?.originItem?.title}}
                                  </span>
                                </div>
                              </ng-template>

                              </d-operable-tree>
                            </div>
                          </div>
                          <div class="momOption">
                            <div class="processOption" *ngIf="this.momOptionDisplay.processOptionDisplay">
                              <div>
                                <h4>工序配置</h4>
                                <div class="grid mt-3">
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label"><span class="Required">*</span>工序序号</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <d-input-number class="input-number"   [(ngModel)]="selectProcessNode.processNumber" (ngModelChange)="editProcessNumber()" [min]="1"  [dValidateRules]="FormRules.processNumber" [ngModelOptions]="{standalone: true}"></d-input-number>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label"><span class="Required">*</span>工序编码</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <input dTextInput class="form-input-box" name="工序编码" [(ngModel)]="selectProcessNode.processNum" [dValidateRules]="FormRules.processNum" (click)="selectProcess()">
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label"><span class="Required">*</span>工序名称</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <input dTextInput class="form-input-box" name="工序名称" [(ngModel)]="selectProcessNode.processName" [dValidateRules]="FormRules.processName" (click)="selectProcess()">
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label"><span class="Required">*</span>生产数量</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <d-input-number class="input-number" name="生产数量p" [allowEmpty]="true" [(ngModel)]="selectProcessNode.productionQuantity" [disabled]="true" [dValidateRules]="FormRules.productionQuantityP" [min]="0"></d-input-number>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label"><span class="Required">*</span>标准工时</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <div class="input-group">
                                          <d-input-number class="input-number" name="标准工时" [allowEmpty]="true" [(ngModel)]="selectProcessNode.unitTime"  (ngModelChange)="workTimesChange()"  [min]="0"[dValidateRules]="FormRules.unitTime"></d-input-number>
                                          <input type="text" dTextInput class="form-input-box" value="小时" name="工时单位" disabled [(ngModel)]="selectProcessNode.workingHoursUnit">
                                        </div>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label"><span class="Required">*</span>工序总工时</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <div class="input-group">
                                          <d-input-number class="input-number" name="工序总工时" [allowEmpty]="true" [(ngModel)]="this.selectProcessNode.totalWorkingHours" [disabled]="true"  [dValidateRules]="FormRules.unitTime"></d-input-number>
                                          <input type="text" dTextInput class="form-input-box" value="小时" name="工时单位" disabled [(ngModel)]="selectProcessNode.workingHoursUnit">
                                        </div>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label">是否外包</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <d-toggle name="是否外包" [(ngModel)]="selectProcessNode.isOutsourcing"></d-toggle>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label"><span class="Required">*</span>计划开工时间</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <d-datepicker-pro    [format]="'y-MM-dd HH:mm:ss'"
                                        name="计划开工时间" [(ngModel)]="selectProcessNode.planStartTime" [dValidateRules]="FormRules.planStartTime"  [showTime]="true"></d-datepicker-pro>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label">是否首检</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <d-toggle name="是否首检" [(ngModel)]="selectProcessNode.isFirstInspection"></d-toggle>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label"><span class="Required">*</span>计划完工时间</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <d-datepicker-pro   [format]="'y-MM-dd HH:mm:ss'"
                                        name="计划完工时间" [(ngModel)]="selectProcessNode.planFinishTime"  [dValidateRules]="FormRules.planFinishTime"  [showTime]="true"></d-datepicker-pro>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label">是否检验</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <d-toggle name="是否检验" [(ngModel)]="selectProcessNode.isInspection"></d-toggle>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-2"></div>
                                  <div class="u-1-1">
                                    <d-form-item>
                                      <d-form-label>
                                        <span class="label"><span class="Required"></span>工序说明</span>
                                      </d-form-label>
                                      <d-form-control>
                                        <textarea dTextarea class="form-textarea" name="工序说明" [(ngModel)]="selectProcessNode.processNote"></textarea>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                  <div class="u-1-1">
                                    <d-form-item>
                                      <d-form-label>
                                      </d-form-label>
                                      <d-form-control>
                                      </d-form-control>
                                    </d-form-item>
                                  </div>
                                </div>
                              </div>
                              <div>
                                <h4>物料列表</h4>
                                <div class="table" *ngIf="selectProcessNode.parts.length>0">
                                  <d-data-table [dataSource]="selectProcessNode.parts" [lazy]="true" [scrollable]="true" [fixHeader]="true"    [tableOverflowType]="'auto'" [scrollable]="true"   [resizeable]="true" >
                                    <thead dTableHead >
                                      <tr dTableRow>
                                        <th dHeadCell>物料序号</th>
                                        <th dHeadCell>物料编码</th>
                                        <th dHeadCell>物料名称</th>
                                        <th dHeadCell>单位用量</th>
                                        <th dHeadCell>单位</th>
                                        <th dHeadCell>损耗率(%)</th>
                                        <th dHeadCell>损耗数量</th>
                                        <th dHeadCell>固定损耗</th>
                                        <th dHeadCell>是否固定数量</th>
                                        <th dHeadCell>需求数量</th>
                                      </tr>
                                    </thead>
                                    <tbody dTableBody>
                                      <ng-template let-rowItem="rowItem" let-rowIndex="rowIndex">
                                        <tr dTableRow>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.partNumber">{{rowItem.partNumber}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.partNum">{{rowItem.partNum}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.partName">{{rowItem.partName}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.unitUsage">{{rowItem.unitUsage}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.unit">{{rowItem.unit}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span *ngIf="rowItem.isPercentage" dTooltip [content]="rowItem.lossRate">{{rowItem.lossRate}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span *ngIf="!rowItem.isPercentage" dTooltip [content]="rowItem.lossRate">{{rowItem.lossRate}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.fixedLoss">{{rowItem.fixedLoss}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.isFixedQuantity | YesOrNo">{{rowItem.isFixedQuantity | YesOrNo}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.requirementQuantity">{{rowItem.requirementQuantity}}</span>
                                          </td>
                                        </tr>
                                      </ng-template>
                                    </tbody>
                                  </d-data-table>
                                </div>
                                <div class="" *ngIf="selectProcessNode.parts.length==0">
                                  暂无数据
                                </div>
                              </div>
                              <div class="">
                                <d-button (btnClick)="addMatrial()">添加物料</d-button>
                              </div>
                            </div>
                            <div class="partOption" *ngIf="this.momOptionDisplay.partOptionDisplay">
                              <div>
                                <h4>物料配置</h4>
                              </div>
                              <div class="grid mt-3">
                                <div class="u-1-2">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label"><span class="Required">*</span>物料序号</span>
                                    </d-form-label>
                                    <d-form-control>
                                      <d-input-number class="input-number" name="物料序号"  [(ngModel)]="selectPartNode.partNumber"  [min]="1" [dValidateRules]="FormRules.partNumber" (ngModelChange)="editPartNumber()"></d-input-number>
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                                <div class="u-1-2">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label"><span class="Required">*</span>物料编码</span>
                                    </d-form-label>
                                    <d-form-control>
                                      <input dTextInput class="form-input-box" name="物料编码" [(ngModel)]="selectPartNode.partNum" [dValidateRules]="FormRules.partNum" (click)="SelectPart()">
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                                <div class="u-1-2">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label"><span class="Required">*</span>物料名称</span>
                                    </d-form-label>
                                    <d-form-control>
                                      <input dTextInput class="form-input-box" name="物料名称" [(ngModel)]="selectPartNode.partName" [dValidateRules]="FormRules.partName" (click)="SelectPart()">
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                                <div class="u-1-2">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label"><span class="Required">*</span>单位用量</span>
                                    </d-form-label>
                                    <d-form-control>
                                      <div class="input-group">
                                        <d-input-number class="input-number" name="单位用量" [allowEmpty]="true"  [(ngModel)]="selectPartNode.unitUsage" (ngModelChange)="unitUsageChange($event)" [min]="0"></d-input-number>
                                        <input type="text" dTextInput class="form-input-box" value="" name="单位" [dValidateRules]="FormRules.unitUsage" disabled [(ngModel)]="selectPartNode.unit" >
                                      </div>
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                                <div class="u-1-2">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label">是否固定数量</span>
                                    </d-form-label>
                                    <d-form-control>
                                      <d-toggle name="是否固定数量" [(ngModel)]="selectPartNode.isFixedQuantity" (ngModelChange)="isFixedQuantityChange($event)"></d-toggle>
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                                <div class="u-1-2">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label">损耗类型</span>
                                    </d-form-label>
                                    <d-form-control>
                                      <d-radio-group
                                      [name]="'item-group'"
                                      [values]="loss"
                                      [direction]="'row'"
                                      [(ngModel)]="lossType"
                                      (ngModelChange)="lossTypeChange($event)"
                                      >
                                      </d-radio-group>
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                                <div class="u-1-2">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label">损耗</span>
                                    </d-form-label>
                                    <d-form-control>
                                      <div class="input-group">
                                        <d-input-group [suffixContent]="comparison">
                                          <d-input-number class="input-number" name="损耗率" [allowEmpty]="true" [(ngModel)]="lossRate" [disabled]="this.selectPartNode.isFixedQuantity || this.lossType=='固定损耗'" [min]="0" (ngModelChange)="lossRateChange($event)"></d-input-number>
                                        </d-input-group>
                                        <ng-template #comparison>
                                          <div dDropDown appendToBody class="comparison-symbol-box" [disabled]="this.selectPartNode.isFixedQuantity || this.lossType=='固定损耗'">
                                            <span dDropDownToggle>{{ lossType2 }}</span>
                                            <ul dDropDownMenu class="comparison-symbol-list">
                                              <li *ngFor="let symbol of loss2" (click)="lossTypeChange2(symbol)">
                                                <a dDropDownMenuItem>{{ symbol }}</a>
                                              </li>
                                            </ul>
                                          </div>
                                        </ng-template>
                                      </div>
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                                <div class="u-1-2">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label">固定损耗</span>
                                    </d-form-label>
                                    <d-form-control>
                                      <div class="input-group">
                                        <div class="input-group">
                                          <d-input-number class="input-number" name="固定损耗" [allowEmpty]="true" [(ngModel)]="selectPartNode.fixedLoss" [disabled]="this.selectPartNode.isFixedQuantity || this.lossType!=='固定损耗'" [min]="0" (ngModelChange)="fixLossChange()"></d-input-number>
                                        </div>
                                      </div>
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                                <div class="u-1-2">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label"><span class="Required">*</span>需求数量</span>
                                    </d-form-label>
                                    <d-form-control>
                                        <div class="input-group">
                                          <d-input-number class="input-number" name="需求数量" [allowEmpty]="true" [disabled]="true" [(ngModel)]="selectPartNode.requirementQuantity" [min]="0"></d-input-number>
                                          <input type="text" dTextInput class="form-input-box" value="" name="单位" disabled [(ngModel)]="selectPartNode.requirementUnit">
                                        </div>
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                                <div class="u-1-1">
                                  <d-form-item>
                                    <d-form-label>
                                      <span class="label"><span class="Required"></span>物料说明</span>
                                    </d-form-label>
                                    <d-form-control>
                                      <textarea dTextarea class="form-textarea" name="物料说明" [(ngModel)]="selectPartNode.partNote"></textarea>
                                    </d-form-control>
                                  </d-form-item>
                                </div>
                              </div>
                            </div>
                            <div class="processList" *ngIf="this.momOptionDisplay.processListDisplay">
                              <div>
                                <h4>工序列表</h4>
                                <div class="table">
                                  <d-data-table [dataSource]="this.Ticket.jobOrderProcesses" [lazy]="true" [scrollable]="true" [fixHeader]="true"  [scrollable]="true"  [resizeable]="true" [tableWidthConfig]="tableWidthConfigProcess">
                                    <thead dTableHead>
                                      <tr dTableRow>
                                        <th dHeadCell>工序序号</th>
                                        <th dHeadCell>工序编码</th>
                                        <th dHeadCell>工序名称</th>
                                        <th dHeadCell>生产数量</th>
                                        <th dHeadCell>单位工时</th>
                                        <th dHeadCell>工时单位</th>
                                        <th dHeadCell>工序总工时</th>
                                        <th dHeadCell>检验</th>
                                        <th dHeadCell>委外/自制</th>
                                        <th dHeadCell>计划开工时间</th>
                                        <th dHeadCell>计划结束时间</th>
                                        <th dHeadCell>工序说明</th>
                                      </tr>
                                    </thead>
                                    <tbody dTableBody>
                                      <ng-template let-rowItem="rowItem" let-rowIndex="rowIndex">
                                        <tr dTableRow>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.processNumber">{{rowItem.processNumber}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.processNum">{{rowItem.processNum}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.processName">{{rowItem.processName}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.productionQuantity">{{rowItem.productionQuantity}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.standardWorkingHours">{{rowItem.standardWorkingHours}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.workingHoursUnit">{{rowItem.workingHoursUnit}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.totalWorkingHours">{{rowItem.totalWorkingHours}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span *ngIf="rowItem.isFirstInspection" dTooltip [content]="'首检'">
                                              <d-tag [tag]="rowItem.isFirstInspection | booleanToText:'首检'"></d-tag>
                                            </span>
                                            <span *ngIf="rowItem.isInspection" style="margin-left: 3px;" dTooltip [content]="'检验'">
                                              <d-tag [tag]="rowItem.isInspection | booleanToText:'检验'"></d-tag>
                                            </span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.isOutsourcing ? '委外' : '自制'">
                                              <d-tag [tag]="rowItem.isOutsourcing | booleanToText:'委外':'自制'"></d-tag>
                                            </span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.planStartTime">{{rowItem.planStartTime | date:'yyyy-MM-dd HH:mm:ss'}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.planFinishTime">{{rowItem.planFinishTime | date:'yyyy-MM-dd HH:mm:ss'}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.processNote">{{rowItem.processNote}}</span>
                                          </td>
                                        </tr>
                                      </ng-template>
                                    </tbody>
                                  </d-data-table>
                                </div>
                                <div class="">
                                  <d-button (btnClick)="addProcess()">添加工序</d-button>
                                </div>
                              </div>
                            </div>
                            <div class="partList" *ngIf="this.momOptionDisplay.partListDisplay">
                              <div>
                                <h4>物料列表</h4>
                                <div class="table">
                                  <d-data-table [dataSource]="selectPartList" [lazy]="true" [scrollable]="true" [fixHeader]="true"    [tableOverflowType]="'auto'" [scrollable]="true"   [resizeable]="true" >
                                    <thead dTableHead >
                                      <tr dTableRow>
                                        <th dHeadCell>物料序号</th>
                                        <th dHeadCell>物料编码</th>
                                        <th dHeadCell>物料名称</th>
                                        <th dHeadCell>单位用量</th>
                                        <th dHeadCell>单位</th>
                                        <th dHeadCell>损耗率(%)</th>
                                        <th dHeadCell>损耗数量</th>
                                        <th dHeadCell>固定损耗</th>
                                        <th dHeadCell>是否固定数量</th>
                                        <th dHeadCell>需求数量</th>
                                      </tr>
                                    </thead>
                                    <tbody dTableBody>
                                      <ng-template let-rowItem="rowItem" let-rowIndex="rowIndex">
                                        <tr dTableRow>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.data.partNumber">{{rowItem.data.partNumber}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.data.partNum">{{rowItem.data.partNum}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.data.partName">{{rowItem.data.partName}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.data.unitUsage">{{rowItem.data.unitUsage}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.data.unit">{{rowItem.data.unit}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span *ngIf="rowItem.data.isPercentage" dTooltip [content]="rowItem.data.lossRate">{{rowItem.data.lossRate}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span *ngIf="!rowItem.data.isPercentage" dTooltip [content]="rowItem.data.lossRate">{{rowItem.data.lossRate}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.data.isFixedQuantity | YesOrNo">{{rowItem.data.isFixedQuantity | YesOrNo}}</span>
                                          </td>
                                          <td dTableCell>
                                            <span dTooltip [content]="rowItem.data.requirementQuantity">{{rowItem.data.requirementQuantity}}</span>
                                          </td>
                                        </tr>
                                      </ng-template>
                                    </tbody>
                                  </d-data-table>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </d-panel-body>
                    </d-panel>
                  </div>
                </div>
                <d-form-operation>
                  <d-button bsStyle="primary" dFormSubmit >确定</d-button>
                  <d-button class="ms-3" bsStyle="common" (btnClick)="cancel()">取消</d-button>
                </d-form-operation>
            </form>
          </div>
        </div>

  </div>
</div>

<d-toast [value]="msgs" [life]="2000" [styleClass]="'custom-class'" [style]="{ left: '50%',top:'10px' }"></d-toast>
